package src.lab02.test03;

public class Student {
    //属性：计算机成绩，数学成绩，英语成绩。
    float computerScore;
    float matchScore;
    float englishScore;

    //行为：求总分,平均分，最高分，最低分，并且可以输出一个学生的完整信息。
    float sum(){
        return computerScore+matchScore+englishScore;
    }
    float average(){
        return (computerScore+matchScore+englishScore)/3;
    }
    void maxScore(){  String str;
        float max = computerScore;
        if (matchScore > max) {
            max = matchScore;
            str = "数学";
        } else {
            max = computerScore;
            str = "计算机";
        }

        if (englishScore > max) {
            max = englishScore;
            str = "英语";
        }

        System.out.println("最高分:" + str + max);   }
    void minScore(){ String str;
        float min = computerScore;
        if (matchScore < min) {
            min = matchScore;
            str = "数学";
        } else {
            min = computerScore;
            str = "计算机";
        }
        if (englishScore < min) {
            min =englishScore;
            str = "英语";
        }
        System.out.println("最低分:" + str + min);   //三科中的最低分
    }

    void printStudent(){

    }
}
